{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}	

{$html->toolbar->title('##Configuration## - ##Smilies##')}
{$html->toolbar->deleteList()}
{$html->toolbar->editList()}
{$html->toolbar->popupAdd()}

{* 
  MH - 20090924 - added this routine to toggle all smilies 
  this javascript routine uses mootools
*}
{literal}
<script type="text/javascript">
  function toggleChecks()
  {
    var akCbs = $$('input', {'type': 'checkbox'} );

    for( iX=0; iX<akCbs.length; ++iX )
    {
      // !!! - a better check should be implemented to test for 
      //       valid checkbox names... there may be a way with smarty.
      if( akCbs[iX].name !== "toggle" && akCbs[iX].name === "cid[]" )
      {
        akCbs[iX].checked = $('toggle').checked;
      }
    }
  }

</script>
{/literal}

<div style="float:left; width: 10%;">
	{include file=configuration/links.tpl}
</div>

<div style="float:right; width: 90%;">
	<form name="adminForm" method="POST">
		<input type="hidden" name="checked" value="0"/>
		<input type="hidden" name="agora_task" value="configuration"/>
		<input type="hidden" name="task" value=""/>
		<input type="hidden" name="page" value="smilies"/>
		<input type="hidden" name="option" value="com_agora"/>
		<input type="hidden" name="boxchecked" value="0"/>
		<fieldset>
			<legend>##CURRENT SMILIES##</legend>
			<table class="adminlist">
				<thead>
					<th width="20">
            <input type="checkbox" id="toggle" name="toggle" value="" onclick="toggleChecks();" />
					</th>
					<th>##Code##</th>
					<th>##Image Filename##</th>
					<th>##Image##</th>
				</thead>
				<tfoot>
					<tr><td colspan="4">{$pagination->getListFooter()}</td></tr>
				</tfoot>
				<tbody>
					{foreach from=$smilies key=num item=smile}
					<tr>
						<td>{$html->jhtml('grid.id', $num, $smile.id)}</td>
						<td>{$smile.text}</td>
						<td>{$smile.image}</td>
						<td><img src="{$site_url}img/smilies/{$smile.image}" /></td>
					</tr>
					{foreachelse}
					<tr><td colspan="4">##No smilies defined##</td></tr>
					{/foreach}
				</tbody>
			</table>
		</fieldset>
	</form>
</div>
